package com.monochromebytes.mononet.virtual;

import com.monochromebytes.mononet.packet.IncomingPacket;

public class IncomingDataPacket extends DataPacket {

    private final VirtualAddress connectionAddress;

    public IncomingDataPacket(IncomingPacket packet) {
        super(packet);

        // Create the connection address object.
        this.connectionAddress = new VirtualAddress(this.getReceipient(), this.getSender(),
                this.getConnectionID());
    }

    @Override
    public IncomingPacket getUDPPacket() {
        return (IncomingPacket) super.getUDPPacket();
    }

    @Override
    public VirtualAddress getConnectionAddress() {
        return this.connectionAddress;
    }
}
